<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/Public/global/js/jquery.min.js"></script>
    <script type="text/javascript">
       $(function(){
           $("#Btn_Submit").bind('click', function () {
               var username = $("input[name='username']").val();
               var password = $("input[name='password']").val();
               var code = $("input[name='code']").val();

               $.ajax({
                   'url' : '__SELF__',
                   'type' : 'post',
                   dataType: "json",
                   'data' : {
                       "username" : username,
                       "password" : password,
                       "code" : code
                   },
                   success : function (data) {
                       console.log(data);
                       if(data.code != 3) {
                           alert(data.msg);
                       }else{
                           location.href = '/index.php/Admin/Index'
                       }
                   }
               });


           });

       });
    </script>
</head>
<body>
<!-- 后台登陆表单 -->
    <form action="__SELF__" method="post">
    <table>
         <tr>
             <td>账号：</td>
             <td><input type="text"  name="username"></td>
         </tr>
         <tr>
             <td>密码：</td>
             <td> <input type="password" name="password"></td>
         </tr>
        <tr>
            <td>验证码：</td>
            <td>
                <input type="text" maxlength="4" name="code"/> &nbsp;&nbsp; <img src="{:U('Admin/Login/Login_Code')}" onClick="this.src= '/index.php/Admin/Login/Login_Code.html?' +Math.random()" alt="验证码">
            </td>
        </tr>


        <tr>
            <td> <input type="button" value="登陆" id="Btn_Submit"></td>
        </tr>
    </table>
    </form>
</body>
</html>